<!--edit page create by pionner at Mon Nov 24 15:18:30 CST 2008-->
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@taglib uri="ttp://www.security.com/tag" prefix="sc"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
	<base href="<%=basePath%>">
		<title>Department</title>
		<link rel="stylesheet" href="css/style.css"										>
		<link href="template/css.css" rel="stylesheet" type="text/css">
<script type="text/javascript">
function del(){

document.delform.submit();
parent.location.reload();
}

</script>
	</head>
	<body>
		<table width="200" border="0" cellspacing="0" cellpadding="0">
			<tr>
				<td width="90"><img src="images/loc-head.jpg" width="90" height="24"></td>
				<td valign="middle" nowrap background="images/loc-bg.jpg" class="title">部门编辑-<s:property value="name"/> </td>
				<td width="12"><img src="images/loc-tail.jpg" width="12" height="24"></td>
				<td width="12"></td>
			
			</tr>
		</table><br>

		<!--  <table>
			<tr>
				<td background="1images/tb-bg.jpg" width="120">&nbsp;
					<a href="javascript:document.all.addform.submit()" >
					    <sc:img processcode="button_subsearch" src="images/btn-submit.jpg" tip=""/>
						<!--  <img src="images/btn-submit.jpg" border="0" style="cursor:hand;">
					</a>
				</td>
				<td background="1images/tb-bg.jpg" width="120">&nbsp;
					<a href="<s:url action='departmentDetail'><s:param name="id" value="id" /></s:url>" >
						<sc:img processcode="button_del" src="images/btn-del.jpg" tip=""/>
						<!--  <img src="images/btn-del.jpg" width="104" height="21" border="0" style="cursor:hand;">
					</a>
				</td>
				<td background="1images/tb-bg.jpg" width="120">&nbsp;
					<a href="<s:url action="departmentList"><s:param name="id" value="id" /></s:url>" >
							<sc:img processcode="btn-list.jpg" src="images/btn-list.gif" tip=""/>
						<!--  <img src="images/btn-list.jpg" width="104" height="21" border="0" style="cursor:hand;">

					</a>
				</td>
			</tr>
		</table>

		<hr>-->
		
		<s:form name="addform"  action="departmentSave.action">
			<s:hidden value='condition'/>
			<table width='100%' border='0' cellspacing='1' class="ipttable">
				<s:hidden name='id' label='ID'/>
				<s:textfield cssClass="input180" name='code' label='部门编码'/>
				<s:textfield cssClass="input180" name='name' label='部门名称'/>
				<s:textfield cssClass="input180" name='remark' label='备注'/>
				<s:hidden id="pid" name='pid' label='pid'/>
				<s:hidden onclick="openform()" id="departmentName" name='departmentName' label='父部门'/>
			
			</table>
			<table width='80%' border='0' cellspacing='0' >
			<tr>
			<td align="center">
			<input type="button" value="提交" onClick="javascript:document.all.addform.submit()" class="submitbtn">
			<input type="reset" value="重置" class="resetbtn">
			<input type="button" value="返回" onClick="javascript:history.back(-1)" class="backbtn">
					
			
			</td>
			</tr>
			</table>
		</s:form>
	</body>
</html>
<script type="text/javascript">
    	function openform(){
    		var title = ""; 
		var url = 'deptSel.jsp';
		var pageUrl="<%=basePath%>/jsp/deptSel.jsp";
		var paraObj = new Object();
		paraObj.url=url;
		paraObj.title=title;
		var objId=document.getElementById("pid");
		var objName=document.getElementById("departmentName");
		paraObj.input=objId;
		var sFeatures = 'help:no;status:1;dialogHeight:500px;dialogWidth:350px;center:1';
	    var rtnObj= window.showModalDialog(pageUrl,paraObj,sFeatures );
	    //alert('rtnObj='+rtnObj);
		if(rtnObj){
			var result=rtnObj.result;
			objId.value=result.id;
			objName.value=result.name;
		}else{
    		
    	}
    	//alert('openform');
    	}
    </script>
